package chaper08;
public class example02 {
        public static void modifySalary(int salary){
            salary += 1000;
        }
        public static void modifySalary(Staff staff){
            staff.salary += 1000;
        }
        public static void main(String []args){
            Staff staff = new Staff();
            staff.name = "小王";
            staff.salary = 5000;
            System.out.println(staff.name+"原本薪水是:"+staff.salary+"元/月");
            modifySalary(staff.salary);
            System.out.println("值传递加薪是:"+staff.salary+"元/月");
            modifySalary(staff);
            System.out.println("值传递加薪是:"+staff.salary+"元/月");
        }
    }